<template>
	<view class="pl-30 pt-30 pr-30 pb-30">
		<rich-text :nodes="nodes"></rich-text>
	</view>
</template>

<script>
	import {
		getPolicyApi
	} from '@/api/global/index';
	
	import { getSlideInfoApi } from '@/api/index/index'
	export default {
		data() {
			return {
				nodes: ''
			}
		},
		onLoad({ type, actType }) {
			if (actType == 1) {
				this.getBannerInfo(type)
			} else {
				this.getPolicy(type)
			}
		},
		methods: {
			async getPolicy (type) {
				const { data } = await getPolicyApi({ type });
				uni.setNavigationBarTitle({
					title: data.title
				});
				this.nodes = data.content
			},
			async getBannerInfo (id) {
				const { data } = await getSlideInfoApi({ id });
				uni.setNavigationBarTitle({
					title: data.title
				});
				this.nodes = data.path
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>